package test

import (
	"io/ioutil"
	"net/http"
	"path"
	"github.com/gin-gonic/gin"
)

func GetPicture(c *gin.Context) {
	file := "data/static/KID.jpg"
	ext := path.Ext(file)
	picBytes, _ := ioutil.ReadFile(file)
	c.JSON(http.StatusOK, gin.H{
		"code" : 200, 
		"data" : gin.H{
			"base64" : picBytes, 
			"type" : ext[1:],
		},
	})
}